class Solution {
public:
    vector<int> exchange(vector<int>& nums) {
        //1223
        int odd=0;//奇数
        int even=0;//偶数
        while(even<nums.size()){
            if(nums[even]%2==1){//奇数
                int temp=nums[even];
                nums[even]=nums[odd];
                nums[odd]=temp;
                odd++;
            }
            even++;
        }
        return nums;
    }
};